<me:UIEXART x:Class="WPFExcelReport.TEXART"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR"  
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIEXART.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby1440  x:Key="day"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:TIMES100  x:Key="X100"/>
        <ucd:TIMES10  x:Key="X10"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIEXART.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" Grid.ColumnSpan="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"  Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Center"  
                           Text="ResetDB"  ></TextBlock>
                <Button Grid.Column="1"  Margin="0,0,0,0"  Width="30" Height="30" Click="btnResetDB_Click">
                    <Button.Background> 
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                    </Button.Background>
                </Button>
            </Grid>
            <DR:TDRAUFTR Name="cDR" Visibility="Collapsed"
                    DocType="LOADEXCEL"  
                             DESTFOLDER="{Binding ART,ElementName=TV}"
                             PREFIX="{Binding VAR,ElementName=TV}"
                             />
            <TextBox Text="{Binding ART,ElementName=TV}" Width="200"/>
            <TextBox Text="{Binding VAR,ElementName=TV}" Width="60"/>
            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=ExcelLoad}}" Click="LoadExcelCommand" Visibility="Collapsed"></Button>
            <Grid Margin="20,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=Article}}" VerticalAlignment="Center" ></TextBlock>
                <TextBox Grid.Column="1"   Name="txtLART" Background="LightYellow" CharacterCasing="Upper"  Width="200" Height="30"></TextBox>

            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"  Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Center"   
                           Text="{Binding Source={Localization:Translate Word=LoadArt}}"  ></TextBlock>
                <Button Grid.Column="1"  Margin="0,0,0,0"  Width="30" Height="30" Click="QueryCommand">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/download.png" />
                    </Button.Background>
                </Button>
            </Grid>
            <Grid Visibility="Collapsed">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0"    Width="30" Height="30" Click="cmdFilterART_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <Button Grid.Column="1"  Name="btnArtClear" Click="btnArtClear_Click" Width="Auto">Clear</Button>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
            </Grid>
        </WrapPanel>
        <DataGrid  Grid.Row="1" VerticalAlignment="Top"  Grid.Column="0"
                                   AutoGenerateColumns="False"
                                   EnableRowVirtualization="False"
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column"                 
                                   HorizontalAlignment="Stretch"               
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                                   x:Name="dlgMaster" 
                                   Margin="0,1,0,0"             
                                   RowDetailsVisibilityMode="Visible" Grid.ColumnSpan="4">
            <DataGrid.Columns> 
            <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="Barcode"  Width="Auto" />
            <DataGridTextColumn Binding="{Binding Path=DESCRIPTION}" Header="Article NO"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=COMPOSITION}" Header="Width"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WEIGHT}" Header="Weight"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WIDTH}" Header="Width"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=CODE}" Header="Code"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BOOK}" Header="Book"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LOCATION}" Header="Location"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=PRICE}" Header="Price"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=SUPPLIER}" Header="Supplier"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="Remark"  Width="Auto" /> 
            </DataGrid.Columns>
        </DataGrid  >
        <ex:TPage Grid.Row="2" Visibility="{Binding IsPage,ElementName=TV,Converter={StaticResource bv}}"/>
        <Grid Visibility="{Binding IsBusy,ElementName=TV,Converter={StaticResource bv}}"  Grid.Row="0" Grid.RowSpan="3" >
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding INFO}"  Grid.Row="0"
                   FontSize="28"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Foreground="Green"
                   />
            <TextBlock Text="{Binding VAR}"  Grid.Row="1"
                   FontSize="28"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Foreground="Green"
                   />
            <TextBlock Text="{Binding Source={Localization:Translate Word=Seconds:}}"  Grid.Row="2"
                   FontSize="28"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Foreground="Red"
                   />
            <TextBlock Text="{Binding USEC}"  Grid.Row="3"
                   FontSize="28"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Foreground="Red"
                   />
            
        </Grid>
       
    </Grid> 
</me:UIEXART> 
 
